import request from '@/utils/request'

// 查询智能商品库列表
export function listProduct(query) {
  return request({
    url: '/fiscale/product/list',
    method: 'get',
    params: query
  })
}

// 查询智能商品库详细
export function getProduct(productId) {
  return request({
    url: '/fiscale/product/' + productId,
    method: 'get'
  })
}

// 新增智能商品库
export function addProduct(data) {
  return request({
    url: '/fiscale/product',
    method: 'post',
    data: data
  })
}

// 修改智能商品库
export function updateProduct(data) {
  return request({
    url: '/fiscale/product',
    method: 'put',
    data: data
  })
}

// 删除智能商品库
export function delProduct(productId) {
  return request({
    url: '/fiscale/product/' + productId,
    method: 'delete'
  })
}

// 导出智能商品库
export function exportProduct(query) {
  return request({
    url: '/fiscale/product/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

// 获取导入模板
export function importTemplate() {
  return request({
    url: '/fiscale/product/importTemplate',
    method: 'post',
    responseType: 'blob'
  })
}

// 导入数据
export function importData(data) {
  return request({
    url: '/fiscale/product/importData',
    method: 'post',
    data: data
  })
}